package test;
import haxe.rtti.Infos;
import haxe.rtti.CType;
import haxe.rtti.Meta;
/**
 * ...
 * @author liwei
 * 为了兼容js平台。
 * meta描述类要实现haxe.rtti.Infos接口
 * 以getset方式加描述
 * 
 */

class TestMeta extends TestBase
{

	override public function start():Void 
	{
		var cls = Myclass;
		var rtti = Reflect.field(Myclass, "__rtti");
		log(getobj(rtti));
	}
	public static function getRttiTypeTree(cls : Class <Dynamic> ) :TypeTree
	{
		var name = Type.getClassName(cls);
		var rtti = Reflect.field(cls, "__rtti");
		if (rtti == null) {
			return null;
		}
		var x = new haxe.rtti.XmlParser().processElement(Xml.parse(rtti).firstElement());
		return x;
	}
}
class Bean {
	
}

class Myclass implements Infos {
	private var a(default, setaaa):Bean;
	@inject
	private function setaaa(value:Bean):Bean {
		return value;
	}
}